<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>
        <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
                $j(".p1").live("blur",function(){
                    chuoi = $j(this).val();
                    chuoi1 = $j(this).parent().parent().next().next().next().children().next().children().val();
                    chuoi2 = chuoi1.replace("{P1}",chuoi);
                    $j(this).parent().parent().next().next().next().children().next().children().text(chuoi2);
                });
                
                $j(".p2").live("blur",function(){
                    chuoi = $j(this).val();
                    chuoi1 = $j(this).parent().parent().next().next().children().next().children().val();
                    chuoi2 = chuoi1.replace("{P2}",chuoi);
                    $j(this).parent().parent().next().next().children().next().children().text(chuoi2);
                });
            });
        </script>
        <style>
            #main{
                width: 100%;

            }
            #content{
                width: 98%;
                padding: 0;
                margin-left: 1%;
            }
            #footer{
                width: 100%;
            }
            .content_right{

                min-height: 525px;
            }
            .buttonsave {
                background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
                border: 0 none;
                color: white;
                cursor: pointer;
                float: right;
                font-size: 15px;
                font-weight: bold;
                height: 28px;
                margin-right: 20px;
                margin-top: 9px;
                text-transform: uppercase;
                width: 75px;
            }
            .itemlabelsms{
                float:left;
                width: 15%;
                margin-left:5px;
                text-align: right;
                font-size: 11px;
                font-weight: bold;
                color: #2055A1;
                margin-right: 3px;
            }
            .itemlabelsmscolumn{
                float:left;
                width: 80%;
                margin-left:5px;

                font-size: 11px;



            }
            .itemlabelsms1{
                float:left;
                width: 100%;
                margin-left: 5px;
                text-align: left;
                font-size: 11px;
                font-weight: bold;
                color: #2055A1;
                margin-right: 3px;

            }
            .itemrowSMS{
                width:100%;
                float: left;
                margin-bottom: 5px;
                padding: 5px;
            }
            .itemrowSMS1{
                width:100%;
                float: left;
                padding: 5px;
            }
            .topitemsms{
                border-left: 1px solid #CFCFCF;
                border-radius: 3px 3px 3px 3px;
                border-right: 1px solid #CFCFCF;
                border-top: 1px solid #CFCFCF;
                float: left;
                height: 25px;
                line-height: 25px;
              
            }
        </style>
    </head>
    <body>


        <a4j:form>
            <a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.MENU_DAB_VIEW}'></div>" escape="false"/>
            <div id="content">
                <div id="menu_top">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#">
                                    <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                        <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>

                                    </span>
                                </a>

                            </div>
                            <div class="select_hidden departmentlistN850">
                                <ul>
                                    <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                        <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                    <h:outputText value="#{item.label}"/>
                                                </span></a></li> 
                                            </a4j:repeat>
                                </ul>
                            </div>
                        </div>
                    </h:panelGroup>

                </div>
                <div id="content_detail" >
                    <div class="content_right">
                        <div class="content">
                            <div style="float: left;width: 60.3%;margin-left: 20.7%;">
                                <div class="topitemsms">
                                <div class="itemlabelsms1" ><h:outputText value="NGƯỜI GỬI : #{loginSession.login.hoten}"/></div>
                            </div>
                            </div>
                            
                            <div style="float: left;width: 60.3%;border: 1px solid #CFCFCF;border-radius: 3px;margin-left: 20.7%;">
                                <div class="itemrowSMS1"> 
                                    <div class="itemlabelsms1" style="width: 100% !important;"><h:outputText value="SỐ LƯỢNG NGƯỜI GỬI : #{smsController.idpage}"/></div>
                                </div>
                                    <h:panelGroup id="showmessage">    <div class="itemrowSMS" style="width: 100%;">  <h:outputText styleClass="note" style="color:red;" value="#{templateController.messageSMS}"/></div></h:panelGroup>
                                <div class="itemrowSMS"> 
                                    <div class="itemlabelsms"><h:outputText value="Nội dung gửi :"/></div>
                                    <div class="itemlabelsmscolumn"><h:inputText style="width:90%;" value="#{templateController.cv052}"/></div>
                                </div>
                                <div class="itemrowSMS"> 
                                    <div class="itemlabelsms"><h:outputText value="Template SMS :"/></div>
                                    <div class="itemlabelsmscolumn">
                                        <h:selectOneMenu style="width:90%;height:25px;" value="#{templateController.pc050}">
                                            <f:selectItem itemLabel="---------" itemValue="0"/> 
                                            <f:selectItems value="#{m010Controller.combolistM010}"/>
                                            <a4j:support event="onchange"  actionListener="#{templateController.onchangeTemplate}" reRender="template,template1,tem,tem1,tem2"/>
                                        </h:selectOneMenu>
                                    </div>
                                </div>
                                <h:panelGroup id="template1">
                                    <h:panelGroup rendered="#{templateController.pc050!=0}">
                                        <div style="float:left;width: 98%;margin-left: 0.6%;padding: 5px;"> 
                                            <div style="border: 1px solid #B2B7BB;margin-left: 16.3%;width: 71.8%;padding: 5px;">

                                                <h:panelGroup rendered="#{templateController.pc050==3}">
                                                    <span style="color: red;">
                                                        Note : Chỉ thay đổi {P1} và {P2}.Nếu thay đổi sai Nhân Viên tự chịu trách nhiệm
                                                    </span>
                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{templateController.pc050==4}">
                                                    <span style="color: red;">
                                                        Note : Chỉ thay đổi {P3},{P4} và {P5}.Nếu thay đổi sai Nhân Viên tự chịu trách nhiệm
                                                    </span>
                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{templateController.pc050==5}">
                                                    <span style="color: red;">
                                                        Note : Chỉ thay đổi {P1},{P2},{P3},{P4},{P5},{P6},{P7}.Nếu thay đổi sai Nhân Viên tự chịu trách nhiệm
                                                    </span>
                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{templateController.pc050==6}">
                                                    <span style="color: red;">
                                                        Note : Chỉ thay đổi {P2} và {P3}.Nếu thay đổi sai Nhân Viên tự chịu trách nhiệm
                                                    </span>
                                                </h:panelGroup>

                                            </div>
                                        </div>
                                    </h:panelGroup>
                                </h:panelGroup>
                                <div class="itemrowSMS"> 
                                    <div class="itemlabelsms"><h:outputText value="Nội dung :"/></div>
                                    <div class="itemlabelsmscolumn">
                                        <h:panelGroup id="template">
                                            <h:inputTextarea styleClass="pmain" value="#{templateController.cv051}" style=" float: left;height: 32%;width: 89.9%;" />
                                        </h:panelGroup>
                                    </div>
                                </div>
                                <div class="itemrowSMS" style="width: 90.7%;"> 
                                    <a4j:commandButton styleClass="buttonsave" value="SEND" reRender="showmessage" actionListener="#{templateController.saveTemplateSMSTour}"/>                                                                                                          
                                </div>
                            </div>
                            <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                             height="30" width="40" zindex="2000">
                                <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                            </rich:modalPanel>
                            <h:inputHidden value="#{customerExpand.charSearch}" />

                        </div>
                    </div>
                </div>
            </div>
            <rich:modalPanel styleClass="pleaseimage" id="statPane" autosized="true" minHeight="10" minWidth="80"
                             height="10" width="80" zindex="2000">
                <h:graphicImage value="/images/loadingAnimation.gif" alt="ai" />
            </rich:modalPanel>
        </a4j:form>
    </body>
</html>
